<template>
	<div>
		<div class="ban"><img src="../assets/images/sys_ban.jpg"></div>
		<div class="main">
		  <div class="box">
		    <div class="tit"><em>1</em><span>算算你能买得起哪里的厂房</span><em>1</em></div>
		    <ul>
		      <form action="#">
		        <li class='mt1'><img src="../assets/images/jsq.png"></li>
		        <li>
		          <select class=''  name='city' v-model="selectedCity">
		          	<option disabled value="">工厂所在城市</option>
		           	<option value="广州">广州</option>
		           	<option value="东莞">东莞</option>
		           	<option value="深圳">深圳</option>
		           	<option value="佛山">佛山</option>
		           	<option value="中山">中山</option>
		           	<option value="其它城市">其它城市</option>
		          </select>
		        </li>
		        <li>
		          <select class=''  name='city' v-model="selectedIndustry">
		          	  <option disabled value="">工厂所属行业</option>
		           	  <option value="食品饮料">食品饮料</option>
		           	  <option value="电器照明">电器照明</option>
		           	  <option value="机械五金">机械五金</option>
		           	  <option value="生物医药">生物医药</option>
		           	  <option value="智能制造">智能制造</option>
		           	  <option value="化工原料">化工原料</option>
		           	  <option value="其它行业">其它行业</option>
		          </select>
		        </li>
		        <li>
		          <input type="text" placeholder="您的称呼，如刘女士/王先生" v-model="selectedName">
		        </li>
		        <li>
		          <input type="text" placeholder="联系方式，报价立即发给您" v-model="selectedPhone">
		        </li>
		        <li class="mt2">
		          <input type="button" value="免费获取各城市厂房售价" @click="getPrice">
		        </li>
		      </form>
		    </ul>
		  </div>
		  <div class="box">
		    <div class="bt">广东厂房售价走势</div>
		    <div class="zst"><img src="../assets/images/zst.jpg"></div>
		  </div>
		  <div class="box">
		    <div class="bt2">他们说</div>
		    <div class="shuo"> <img src="../assets/images/t1.jpg">
		      <div class="b_r">
		        <h5>132****1456</h5>
		        <p>开厂10年，没想到白为房东打工了10年，泪崩，制造业究竟何去何从。</p>
		      </div>
		    </div>
		    <div class="shuo"> <img src="../assets/images/t2.jpg">
		      <div class="b_r">
		        <h5>151****2426</h5>
		        <p>我想问下，广州有没有商品厂房可以出售呢?</p>
		      </div>
		    </div>
		    <div class="shuo"> <img src="../assets/images/t3.jpg">
		      <div class="b_r">
		        <h5>139****1464</h5>
		        <p>还好，去年年底买了顺德的厂房，买的时候2800一平米，现在都升到4000多了，工厂没挣到钱，厂房却升值了。</p>
		      </div>
		    </div>
		  </div>
		  <div class="foot">
		    <p>阿力士提供大数据支持</p>
		    <p>数据仅供参考，具体售价请百度搜索《阿力士招商网》</p>
		    <p>阿力士提供广东省近30000个厂房租售信息</p>
		    <p>m.qalex.com</p>
		    <div class="mc"><a href="#">我要买厂<img src="images/jt.jpg"></a></div>
		  </div>
		</div>
		<alert :message='message' v-if="openMessage" @closeBtn="closeMessage"></alert>
	</div>
</template>

<script>
	import alert from '../components/public/alert'
	export default{
		components:{alert},
		data(){
			return{
				cityLists:'',
				selectedCity:'',
				selectedIndustry:'',
				selectedName:'',
				selectedPhone:'',
				openMessage:false,
                message:''
			}
		},
		created(){
		},
		methods:{
			
			getPrice(){
				var reg=/^[0-9]+$/;
				if(this.selectedCity == ''){
					this.openMessage = true
					this.message = 	'请选择城市'
				}else if (this.selectedIndustry == '') {
					this.openMessage = true
					this.message = '请选择行业'
				}else if(this.selectedName == ''){
					this.openMessage = true
					this.message = '请填写称呼'
				}else if(this.selectedPhone == ''){
					this.openMessage = true
					this.message = '请填写联系方式'
				}else if(!reg.test(this.selectedPhone)){
					this.openMessage = true
					this.message = '联系方式请填写数字'
				}else{
					this.$post('/api/submit',{industry:this.selectedIndustry,city:this.selectedCity,username:this.selectedName,mobile:this.selectedPhone}).then(res=>{
						if(res.code == 0){
							this.selectedCity = ''
							this.selectedIndustry = ''
							this.selectedName = ''
							this.selectedPhone = ''
							this.openMessage = true
							this.message = '提交成功'
							window._agl && window._agl.push(['track', ['success', {t: 3}]])
						}
				})
				}
			},
			 closeMessage(){
                this.openMessage = false
            }
		}
	}
</script>

<style>
	@import '../assets/css/sys.css';

</style>